package com.zckj.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * ���ݿ������ļ�������
 * @author ZCKJ
 *
 */
public class Constant {
	static String DRIVER_CLASS = "";
	static String URL="";
	static String USERNAME = "";
	static String PASSWORD = "";
    public static String  CONFIGPATH= "";	
    public static String  HTTPURL = "";
    public static String  PORT = "";
    public static String  MQTTPORT = "";
    public static String  HMQTTHOST = "";

    /**
     * 给配置文件赋值
     */
	static{
		InputStream in	= null;
		try {
			Properties properties = new Properties();
			//获取配置文件输入流
			in = Constant.class.getClassLoader().getResourceAsStream("constant.properties");
			//加载配置文件
			properties.load(in);
			DRIVER_CLASS = properties.getProperty("driver");
			URL = properties.getProperty("url");
			USERNAME = properties.getProperty("username");
			PASSWORD = properties.getProperty("password");
			HTTPURL = properties.getProperty("httpurl");
			PORT = properties.getProperty("port");
			MQTTPORT = properties.getProperty("mqttPort");
			HMQTTHOST = properties.getProperty("host");
		} catch (Exception e) {
			e.printStackTrace();
		}finally {
			if(in != null){
				try {
					in.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}
			
	public static void main(String[] args) {
		System.out.println("===============");
	}
}
